package mars.ns

import mars.ns.core._
import dummy.world._;
import mars.ns.selectors.NodeSelection
import mars.ns.statechangers.StateChange

class TurnSimulation[T <: Node](network: Network[T],isEnded: Int => Boolean) 
		extends Simulation(network, isEnded) with NodeSelection[T] with StateChange[T] {
  
    /**
     * Constructor giving a network and an amount of iterations that the simulation may run
     */
    def this(network : Network[T],iterations : Int) = this(network, Simulation.toMaxIterationFunction(iterations) )   

    override def nextIteration {
	    	val node : T = selectNode(network)
	        checkStateChange(node, this)
    }
}